package com.etc.aspectJ;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	public static void main(String[] args) {
		ApplicationContext ctx = 
				new ClassPathXmlApplicationContext("spring-aspectJ_annotation.xml");
		
		ArithmeticCalculator ac = 
				ctx.getBean("arithmeticCalculatorImpl",ArithmeticCalculator.class);
		
		System.out.println(ac.getClass().getName());   //com.sun.proxy.$Proxy7
		int result = ac.add(1, 1);
		 
		System.out.println("Main Result: "  + result );
		
		
//		result  = ac.div(5, 0);
//		
//		System.out.println("Main Result: " + result );
	}
	
}
